﻿using System.Linq;
using SelfManagement.Database.POCO;
using System.Collections.Generic;

namespace SelfManagement.IServices
{
    public interface IArticleCategoryService : IBaseService<ArticleCategory>
    {
        IQueryable<ArticleCategory> QueryUserArticleCategories(string uid);

        List<ArticleCategory> GetUserArticleCategories(string uid);

        ArticleCategory GetUserArticleCategoryById(string uid, string id);

        string GetUserArticleDefautCategoryId(string uid);

        /// <summary>
        /// 将文章转移到默认分类
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="categoryId"></param>
        /// <returns></returns>
        bool TransferArticlesToDefaultCategory(string uid, string categoryId);

        bool DeleteUserCategoryById(string uid, string id);
        
        /// <summary>
        /// 通过分类名称，判断文章分类是否存在
        /// </summary>
        /// <param name="uid">用户id</param>
        /// <param name="category">分类实体</param>
        /// <returns></returns>
        bool IsExistsUserCategoryByName(ArticleCategory category);
        
    }
}
